package com.aggron.dao;

import com.aggron.entity.SysUser;
import com.aggron.params.UserParams;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author liuhuan
 * @since 2018-06-02
 */
public interface SysUserMapper extends BaseMapper<SysUser> {
    /**
     * 根据用户名查询用户
     * @param name
     * @return
     */
    SysUser getSysUserByName(@Param("name") String name);

    /**
     * 通过userIdList查询userList
     * @param userIdList
     * @return
     */
    List<SysUser> getUserListByUserIdList(@Param("userIdList") List<Integer> userIdList);

    /**
     * 当前部门下的用户
     * @param deptId
     * @return
     */
    int countByDeptId(Integer deptId);

    /**
     * 查询列表
     * @param pagination
     * @param userParams
     * @return
     */
    List<Map<String,Object>> listUser(Pagination pagination, UserParams userParams);

    /**
     * 查询总数
     * @param userParams
     * @return
     */
    int countUser( UserParams userParams);

    /**
     * 逻辑删除
     * @param id
     */
    void deleteLogic(@Param("id")Integer id);
}
